﻿@model KRM.Core.vKRMRSViewReplacement
@{
    var isCollectAndReplaceSameDay = (Model.ActionID == 1 || Model.ActionID == 2 || Model.ActionID == 3 || Model.ActionID == 4);
}

@Html.Partial("Partial/_MessageResult")
<input type="hidden" name="replacementid" value="@Model.ReplacementID" />
<input type="hidden" name="disputeid" value="@Model.DisputeID" />
<div class="row-fluid">
    <div class="span5">
        <fieldset>
            <legend>Customer Details</legend>
            <div class="row-fluid">
                <div class="span4">Name</div>
                <div class="span8">
                    <input type="text" class="input-block-level" value="@Model.Customer" />
                </div>
            </div>
            <div class="row-fluid">
                <div class="span4">Address</div>
                <div class="span8">
                    <textarea class="input-block-level" rows="3">@Model.Address</textarea>
                </div>
            </div>
            <div class="row-fluid">
                <div class="span4">Postcode</div>
                <div class="span8">
                    <input type="text" class="input-block-level" value="@Model.Postcode" />
                </div>
            </div>
            <div class="row-fluid">
                <div class="span4">Telephone</div>
                <div class="span8">
                    <textarea class="input-block-level">@Model.Telephone</textarea>
                </div>
            </div>
        </fieldset>
        <fieldset>
            <legend>Collection Details</legend>
            <div class="row-fluid">
                <div class="span4">Collection Items</div>
                <div class="span8">
                    <input type="text" class="input-block-level" value="@Model.Collection_Items" disabled="disabled" />
                </div>
            </div>
            <div class="row-fluid">
                <div class="span4">Number of Parcels</div>
                <div class="span8">
                    <input type="text" class="input-block-level" value="@Model.NumberOfCollectionParcels" disabled="disabled" />
                </div>
            </div>
            <div class="row-fluid">
                <div class="span4">Collection Number</div>
                <div class="span8">
                    <input type="text" class="input-block-level" value="@Model.CourierCollectionNumber" disabled="disabled" />
                </div>
            </div>
            <div class="row-fluid">
                <div class="span4">Collection Date</div>
                <div class="span8">
                    <div class="input-append datetimepicker">
                        <input data-format="MM/dd/yyyy HH:mm:ss PP" type="text" class="input-block-level" value="@Model.CollectionDate" disabled="disabled" />
                        <span class="add-on">
                            <i data-time-icon="icon-time" data-date-icon="icon-calendar" class="icon-calendar"></i>
                        </span>
                    </div>
                </div>
            </div>
            <div class="row-fluid">
                <div class="span4">Collection Courier</div>
                <div class="span8">
                    @Html.DropDownList("CollectionCarrierID", null, "Please select a Carrier", new { @class = "input-block-level", required = "required", disabled = "disabled" })
                </div>
            </div>
        </fieldset>
    </div>

    <div class="span7">
        <div class="border-padding10">
            <div class="row-fluid">
                <div class="span4">Email</div>
                <div class="span8">
                    <input type="text" class="input-block-level" value="@Model.Email" />
                </div>
            </div>
            <div class="row-fluid">
                <div class="span4">Order Reference</div>
                <div class="span8">
                    <input type="text" class="input-block-level" value="@Model.Order_Ref" />
                </div>
            </div>
            <div class="row-fluid">
                <div class="span4">Order Item</div>
                <div class="span8">
                    <input type="text" class="input-block-level" value="@Model.Order_Item" />
                </div>
            </div>
            <div class="row-fluid">
                <div class="span4">RDM Items</div>
                <div class="span8">
                    <input type="text" class="input-block-level" value="@Model.DisputeItems" />
                </div>
            </div>
            <div class="row-fluid">
                <div class="span4">RDM Number</div>
                <div class="span8">
                    <input type="text" class="input-block-level" value="@Model.RDMNumber" />
                </div>
            </div>
        </div>
        <fieldset>
            <legend>Replacement Details</legend>
            <div class="row-fluid">
                <div class="span4">Replacement Items</div>
                <div class="span8">
                    <input type="text" class="input-block-level" name="ReplacementItems" required="required" value="@(string.IsNullOrEmpty(Model.Replacement_Items) ? Model.ApprovedReplacementItems : Model.Replacement_Items)" />
                </div>
            </div>
            <div class="row-fluid">
                <div class="span4">Number of Parcels</div>
                <div class="span8">
                    <input type="number" class="input-block-level" value="@Model.NumberOfParcels" name="NumberOfParcels" required="required" />
                </div>
            </div>
            <div class="row-fluid">
                <div class="span4">Replacement Date</div>
                <div class="span8">
                    <div class="input-append datetimepicker">
                        <input data-format="MM/dd/yyyy HH:mm:ss PP" name="ReplacementDate" type="text" class="input-block-level" value="@(isCollectAndReplaceSameDay ? Model.PreferredCollectionDate : Model.ReplacementDate)" @(isCollectAndReplaceSameDay ? "" : "readonly=readonly")  />
                        <span class="add-on">
                            <i data-time-icon="icon-time" data-date-icon="icon-calendar" class="icon-calendar"></i>
                        </span>
                    </div>
                </div>
            </div>
            <div class="row-fluid">
                <div class="span4">Courier</div>
                <div class="span8">
                    @Html.DropDownList("CarrierID", null, "Please Select a Carrier", new { @class = "input-block-level", required = "required" })
                </div>
            </div>
            <div class="row-fluid">
                <div class="span4">Action</div>
                <div class="span8">
                    @Html.DropDownList("ReplacementActionID", null, "Please Select an Action", new { @class = "input-block-level", required = "required" })
                </div>
            </div>
            <div class="row-fluid">
                <div class="span4">Futher Details</div>
                <div class="span8">
                    <input type="text" class="input-block-level" name="ReplacementActionDetails" value="@Model.ReplacementActionDetails" required="required" />
                </div>
            </div>
        </fieldset>
    </div>
</div>
<div class="border-padding10 text-right">
    <a href="/orderview/orderdetail?orderref=@Model.Order_Ref" class="btn btn-success" style="margin-right: 10px" target="_blank">View Order</a>
    <button type="submit" class="btn btn-primary" style="padding: 5px 30px">Save</button>
</div>
